import request from '@/utils/request';

//监测项目下拉框接口
export function getItemCodeList () {
  return request({
    url: '/drink/autoQualityCalendar/itemList',
    method: 'get',
  });
}

//监测断面下拉框接口
export function getSegmentList () {
  return request({
    url: '/drink/autoQualityCalendar/segmentList',
    method: 'get',
  });
}
export function getSegmentList1 (data = {}) {
  return request({
    url: '/base/segment/list',
    method: 'get',
    params: data
  });
}

// 获取水质日历接口
export function getQualityCalendar (params) {
  return request({
    url: '/drink/autoQualityCalendar/calendarList',
    method: 'get',
    params
  });
}

// 水质报表相关接口项
// 获取自动站日报表格数据
export function getDayReport (params) {
  return request({
    url: '/monitor/autohourdata/dailyReport',
    method: 'get',
    params
  });
}

// 获取自动站周报表格数据（周/月/季度）
export function getWeekReport (params) {
  return request({
    url: '/monitor/autodaydata/weeklyReport',
    method: 'get',
    params
  });
}

// 获取自动站年报表格数据
export function getYearReport (params) {
  return request({
    url: '/monitor/autodaydata/yearReport',
    method: 'get',
    params
  });
}

// 趋势变化分析
export function getTrendAnalysis (params) {
  return request({
    url: '/drinkwater/manualStatistics/drinkSourceTrend',
    method: 'get',
    params
  });
}


/**
 * 水源地巡查记录
 */
// 巡查记录列表
export function getPatrolRecordList (params) {
  return request({
    url: '/drinkwater/drinksourceinpections/list',
    method: 'get',
    params
  });
}
// 删除巡查记录
export function deletePatrolRecord (id) {
  return request({
    url: `/drinkwater/drinksourceinpections/remove/${id}`,
    method: 'post',
    data
  });
}
// 获取巡查记录详情
export function getPatrolRecordDetail (id) {
  return request({
    url: `/drinkwater/drinksourceinpections/${id}`,
    method: 'get',
  });
}
// 新增巡查记录
export function addPatrolRecord (data) {
  return request({
    url: '/drinkwater/drinksourceinpections',
    method: 'post',
    data
  });
}

// 修改巡查记录
export function updatePatrolRecord (data) {
  return request({
    url: '/drinkwater/drinksourceinpections/edit',
    method: 'post',
    data
  });
}
